<html>
	<head>
		<title> Note des étudiants </title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<script type="text/javascript" src="js/jquery.js"></script>
		<!--<script type="text/javascript" src="public/js/d3.v2.js"></script>-->
		<script type="text/javascript">
		

        function ecrirenote(i) {  
        	
			//récupère les informations de l'étudiant
			var nom = $("#etu_nom_"+i).text();
			//$("#idForm2").find("input[name='monInput']").val()
			var exe = document.getElementById('exercice_'+i).value;
			var note = document.getElementById('note_'+i).value;

			/*var exe = document.forms["form"].exercice;
			var note = forms["form"].note;*/
			var p = {"nom":nom, "exercice":exe, "note":note};
			/*
			$.get("ecrire.php", p,
					 function(data){
						alert(data);
					 });
			 */
			$.post("ecrire", p,
					 function(data){
						dataCloud = data;
					 }, "json");
		}

       </script>

		<style>
		
		div.conteneur { 
		  	text-align:left; /* centrage horizontal */
		  	clear:both;
			border-style:solid;
			border-width:2px;	
		}
		div.bloc {
			float:left;
			margin:3px 3px 3px 3px; 	 
		}

		.axis {
		  shape-rendering: crispEdges;
		}
		
		.x.axis line {
		  stroke: #fff;
		}
		
		.x.axis .minor {
		  stroke-opacity: .5;
		}
		
		.x.axis path {
		  display: none;
		}
		
		.y.axis line, .y.axis path {
		  fill: none;
		  stroke: #000;
		}
				
		</style>

	</head>
	<body >	
	<?php 
    $xml = simplexml_load_file("http://picasaweb.google.com/data/feed/base/user/113848708930851956597/albumid/5795380358275112865?alt=rss&kind=photo&hl=fr");
	//local
	//$xml = simplexml_load_file("http://localhost/trombino/trombino/data/5795380358275112865.xml");
	//$xml = simplexml_load_file("http://localhost/trombino/trombino/data/NewFile.xml");
	
	$i=0;
	//foreach ($xml->photo as $item){
	foreach ($xml->channel->item as $item){
		if($i % 2 == 0) $c = 'good'; else $c = 'bad'; 
		
		//$id = $item['id']."";
		//$toto = $item->titi."";
		echo "<div>";
		//echo "<div id='etu_".$i."' class='conteneur' >";
		//echo "<div id='etu_".$i."' class='conteneur' >";
		//echo "<div id='etu_".$i."' class='conteneur' >";
		echo "<div class='note' >";
		echo "<FORM name='form' >";
		echo "</br>";
		echo "Exercice".":"."<INPUT type='text' value='' name='exercice_".$i."'>";
		
		echo "Note".":"."<INPUT type='text' value='' name='note_".$i."'>";
		
		echo "<INPUT type='submit' value='Envoyer' onclick='ecrirenote(".$i.")>";

		echo "<div class='note' >";
		
		
		//echo "</div>";
		//echo "<div class='bloc' >";
	
		echo "<img id='etu_tof_".$i."' src='".$item->enclosure['url']."' class='tof' onclick='getnote(".$i.")' />";
		echo "<div class='$c' id='etu_nom_".$i."'>".$item->title."</div>";
		//echo "<button type='button' value='Enregistrer'  onclick='ecrirenote(".$i.")' />";
		
		//echo "<img src='public/img/timeE.jpg' class='btn' onclick='saveRaison(2,".$i.")' />";
		echo "</div>";
		//echo "<div id='etu_svg_".$i."' class='bloc' ></div>";

		echo "</div>";
		
		$i++;
	}
	?>
	</body>
</html>
